<template>
	<div class="setting">
		<ul>
			<router-link to='setting/loginPass' tag='li'>
				<span>修改密码</span>
				<div class="r">
					<i class="iconfont icon-jiantou"></i>
				</div>
			</router-link>
			<router-link tag='li' to='/user/personal/verified'>
				<span>实名认证</span>
				<div class="r">
					<b>点击认证</b>
					<i class="iconfont icon-jiantou"></i>
				</div>
			</router-link>
			<router-link to='setting/payment' tag='li' v-if="userType == 3">
				<span>支付密码</span>
				<div class="r">
					<i class="iconfont icon-jiantou"></i>
				</div>
			</router-link>
		</ul>
		<!-- <ul>
			<li>
				<span>关于天佑</span>
				<div class="r">
					<i class="iconfont icon-jiantou"></i>
				</div>
			</li>
		</ul> -->
		<div class="logout" @click='logoutEv'>退出登录</div>
		<actionsheet v-model="logoutShow" cancel-text='取消' :menus="logoutMenu" @on-click-menu-delete="onDelete" show-cancel></actionsheet>

		<router-view></router-view>
	</div>
</template>

<script>
import Actionsheet from 'vux/src/components/actionsheet/'
import { logout } from '../../config/getData'
import { getStore } from '../../config/mUtils'

export default {
	data(){
		return {
			testval:['666','112','333'],
			userType:getStore('userInfo')['userType'],
			logoutShow:false,
			logoutMenu:{
				'title.noop': '确定退出?<br/><span style="color:#666;font-size:12px;">推出后某些功能将无法使用</span>',
				delete:'<span style="color:red">确认退出</span>'
			}
		}
	},
	computed:{
	},
	methods:{
		variety(val,ind){
			this.testval[ind] = val
			// console.log(this.testval)
		},
		logoutEv(){
			this.logoutShow = true
		},
		inputEv(html){
			// console.log(html)
		},
		onDelete(val){
			logout().then( res => {
				if(res.code == 2){
					alert('退出成功')
					this.$router.push('/user/login')
				}
			})
		}
	},
	mounted(){
	},
	components:{
		Actionsheet,
	}
}
</script>


<style lang="scss" scoped>
.setting{
	ul{margin-bottom:10px;
		li{line-height: 50px;background-color: white;display: flex;justify-content: space-between;padding:0 20px;
			span{font-size: 15px;color:#030303;}
			i.iconfont{color:#9a9a9a;}
			b{color:#666;font-weight: normal;}
		}
		li + li{margin-top:1px;}
	}
	.logout{line-height: 50px;background-color: white;padding:0 20px;text-align: center;margin-top:40px;font-size: 17px;}
}
</style>

